<!-- app/Resources/views/base.html.twig -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/TR/xml-names/">
    <head>
    <link rel="stylesheet" href="{{ asset('bundles/easydisAPS/css/form.css') }}" type="text/css" media="all" />
    <script type="text/javascript" src="{{ asset('bundles/easydisAPS/js/jquery-1.10.2.min.js') }}"></script>

<script>
    jQuery(function($){

            // simple jQuery validation script
            $('#login').submit(function(){

                    var valid = true;
                    var errormsg = 'Ce champ est requis!';
                    var errorcn = 'error';

                    $('.' + errorcn, this).remove();			

                    $('.required', this).each(function(){
                            var parent = $(this).parent();
                            if( $(this).val() == '' ){
                                    var msg = $(this).attr('title');
                                    msg = (msg != '') ? msg : errormsg;
                                    $('<span class=\"'+ errorcn +'\">'+ msg +'</span>')
                                            .appendTo(parent)
                                            .fadeIn('fast')
                                            .click(function(){ $(this).remove(); })
                                    valid = false;
                            };
                    });

                    return valid;
            });

    })
</script>
</head>
<body>
{# S'il y a une erreur, on l'affiche dans un joli cadre #}
  {% if error %}
    <div class="alert alert-error">{{ error.message }}</div>
  {% endif %}
    
<form id="login" method="post" action="{{ path('login_check') }}"> 

    <h1>Identification Requise</h1>
    <p class="register">Pas de compte? <a href="#">Contactez nous!</a></p>
    
    <div>
    	<label for="login_username">Nom d'utilisateur :</label>
    	<input type="text" size="12px" name="_username" id="login_username" class="field required" title="Nom d'utilisateur requis"/>
    </div>			

    <div>
    	<label for="login_password">Password :</label>
        <input type="password" size="12px" name="_password" id="login_password" class="field required" title="Mot de passe requis"/>
    </div>			
    
    <p class="forgot"><a href="#">Mot de passe perdu?</a></p>
    			
    <div class="submit">
        <button type="submit">Se connecter</button>   
        
        <label>
        	<input type="checkbox" name="remember" id="login_remember" value="yes" />
            Se souvenir de mon nom d'utilisateur
        </label>   
    </div>
</form>	
</body>
</html>